package com.amos.interview.java.method;

/**
 * PROJECT: interview
 * DESCRIPTION: note
 *
 * @author Daoyuan
 * @date 2019/3/29
 */
public class OverLoad {

    private abstract static class Human {

    }

    private static class Woman extends Human {

    }

    private static class Man extends Human {

    }

    public void sayHello(Human human) {
        System.out.println("this is human!");
    }

    public void sayHello(Woman human) {
        System.out.println("this is woman!");
    }

    public void sayHello(Man human) {
        System.out.println("this is man!");
    }

    public static void main(String[] args) {
        OverLoad overLoad = new OverLoad();

        Human woman = new Woman();
        overLoad.sayHello(woman);
        Human man = new Man();
        overLoad.sayHello(man);

        System.out.println("*****************");

        Human human = new Woman();
        overLoad.sayHello(human);
        human = new Man();
        overLoad.sayHello(human);
    }

}
